<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title>layui在线调试</title>
    <link rel="stylesheet" href="/static/layui/css/layui.css" media="all">
    <style>
        body {
            height: 800px;
            margin: 10px;
        }

        .pand_item {
            display: flex;
            align-content: center;
            padding-top: 150px;
            margin-left: 400px;
        }

        #motaikunag {
            display: none;
            !important;
        }

        .pand {
            height: 900px;
            color: red;
            position: fixed;
        }

        .tal_mall {
            height: 600px;
            /*background-color: #FFF*/
        }

        .d_in_b {
            display: inline-block;
        }


        /*    ********************************************************* */
        /*    通用*/
        /*    .bg_color_h{*/
        /*        background-color: #00ff00;*/
        /*    }*/
        /*    .bg_color_blu{*/
        /*        background-color: #0aa1bb;*/
        /*    }*/
        /*    .bg_color_y{*/
        /*        background-color: #00B83F;*/
        /*    }*/
        /*    通用*/
        /*    .member_authrozation{*/

        /*    }*/

        .container_box ul, .container_box li {
            padding: 0;
            margin: 0;
            list-style: none
        }


        /*鼠标划过*/


        .container_box {
            width: 100vw;
        }

        .header_box {
            height: 50px;
        }

        .mall_box {
            height: 90vh;
        }

        .foot_box {
            height: 50px;
        }

        .content_two {
            width: 100vw;
        }

        .layui-this {
            background-color: #00961629;
        }

        /*    */
    </style>
</head>
<body style="margin: 0">
<!--布局容器开始-->
<div class="layui-container container_box" style="margin: 0;padding: 0">

    <div class="layui-row mall_box bg_color_y">
        <div class="layui-tab">
            <ul class="layui-tab-title">
                <li class="layui-this">会员列表</li>
            </ul>
            <div class="layui-tab-content" style="padding: 0;">
                <div class="layui-tab-item  layui-show">
                    <div class="layui-tab-item  layui-show">
                        <div class="layui-tab-item layui-show">
                            <table class="layui-hide" id="demo" lay-filter="test"></table>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <script type="text/html" id="barDemo1">
            <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit1">编辑</a>
            <a class="layui-btn layui-btn-xs" lay-event="more">积分明细</a>
            <a class="layui-btn layui-btn-xs" lay-event="InviteTheDetail">邀请明细</a>
        </script>

    </div>
    <div class="layui-row foot_box bg_color_blu">
        <div align="center" class="pand_item">
            <!--<button class="layui-btn layui-btn-primary  layui-bg-green d_in_b" onclick="prefecture(this)">购买获赠积分规则
            </button>-->
            <!--<button class="layui-btn layui-btn-primary  layui-bg-green d_in_b" onclick="integralSpeedRule(this)">积分加速器规则
            </button>-->
            <!--<button class="layui-btn layui-btn-primary  layui-bg-green d_in_b" onclick="openModak(this)">推荐人奖励规则
            </button>-->
            <!--<button class="layui-btn layui-btn-primary  layui-bg-green d_in_b" onclick="openAmplify(this)">积分放大倍数规则
            </button>-->
            <!--<button class="layui-btn layui-btn-primary  layui-bg-green d_in_b" onclick="openStore(this)">二维码
            </button>
            <button class="layui-btn layui-btn-primary  layui-bg-green d_in_b" onclick="openStoreUrl(this)">下载地址
            </button>-->
            <button class="layui-btn layui-btn-primary  layui-bg-green d_in_b" onclick="openReverse(this)">交换倍数规则
            </button>
            <!--<button class="layui-btn layui-btn-primary  layui-bg-green d_in_b" onclick="openGeneralIntegralSpeedRule(this)">通用积分加速规则
            </button>-->
            <button class="layui-btn layui-btn-primary  layui-bg-green d_in_b" onclick="openGroupRule(this)">团队规则
            </button>
            <!--<button class="layui-btn layui-btn-primary  layui-bg-green d_in_b" onclick="opennvitee(this)">被邀请人规则
            </button>-->
            <button class="layui-btn layui-btn-primary  layui-bg-green d_in_b" onclick="openMember(this)">兑换比例
            </button>
            <!--<button class="layui-btn layui-btn-primary  layui-bg-green d_in_b" onclick="openProducts(this)">商品倍数
            </button>-->
        </div>
    </div>
    <!--    footer-->

</div>
<!--布局容器结束-->


<div id="motaikunag" style="display:none;">
    <div class="layui-row">
        <table class="layui-hide" id="tableMenu" lay-filter="layui-filter"></table>
    </div>
</div>

<div id="motaikuang444" class="layui-row" style="display: none;" scrollbar="false">
    <label>手机号:</label>
    <div class="layui-input-inline">
        <input type="text" id="mobile" class="layui-input"
               placeholder="" autocomplete="off"/>
    </div>
    <label>等级:</label>
    <div class="layui-input-inline">
        <!--<input type="text" id="level" class="layui-input"
               placeholder="" autocomplete="off"/>-->
        <select name="level" id="level" lay-filter="mySelect">
            <option value="1">普通用户</option>
            <option value="2">会员</option>
            <option value="3">推广者</option>
        </select>
    </div>
    <label>原始积分:</label>
    <div class="layui-input-inline">
        <input type="text" id="speed_integral" class="layui-input"
               placeholder="" autocomplete="off"/>
    </div>
    <label>预计可获得兑货卷:</label>
    <div class="layui-input-inline">
        <input type="text" id="forecast_speed_integral" class="layui-input"
               placeholder="" autocomplete="off"/>
    </div>
    <label>佣金:</label>
    <div class="layui-input-inline">
        <input type="text" id="coin" class="layui-input"
               placeholder="" autocomplete="off"/>
    </div>
    <label>提货卷:</label>
    <div class="layui-input-inline">
        <input type="text" id="bill_coupon" class="layui-input"
               placeholder="" autocomplete="off"/>
    </div>
</div>

<div id="motaikuang2" class="layui-row" style="display: none;" scrollbar="false">
    <div class="layui-tab-item">
        <div class="layui-tab-item  layui-show">
            <div class="layui-tab-item layui-show">
                <table class="layui-hide" id="demo1" lay-filter="test"></table>
            </div>
        </div>
    </div>
</div>

<!--<div id="pop-box">
    <div class="layui-row" style="padding-top: 50px">
        <label class="layui-form-label">加速比例:</label>
        <table class="layui-hide" id="integral_speed_rule" lay-filter="layui-filter"></table>
    </div>
</div>-->

<script src="/static/layui/layui.all.js"></script>
<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.js"></script>


<script type="text/html" id="barDemo">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看</a>
    <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
<script>

//积分列表
    layui.config({
        version: '1615148280868' //为了更新 js 缓存，可忽略
    });

    layui.use(['laydate', 'laypage', 'layer', 'table', 'carousel', 'upload', 'element'], function () {
        var laydate = layui.laydate //日期
            , laypage = layui.laypage //分页
            , layer = layui.layer //弹层
            , table = layui.table //表格
            , carousel = layui.carousel //轮播
            , upload = layui.upload //上传
            , element = layui.element //元素操作
        // ,slider = layui.slider //滑块
        // var laytabitem = document.getElementById("table");

        //向世界问个好
        layer.ready(function () {
            //执行一个 table 实例
            //第一个实例.
            table.render({
                elem: '#table'
                , height: 500
                , url: '/system/activity/generalIntegral' //数据接口
                , page: true //开启分页
                , cols: [[ //表头
                    {type: 'checkbox', fixed: 'left'}
                    , {field: 'id', title: 'ID', sort: true}
                    , {field: 'level', title: '级别'}
                    , {field: 'proportion', title: '发放比例', sort: true, totalRow: true}
                    , {fixed: 'right', align: 'center', toolbar: '#barDemo'}
                ]]
            });
        });

        //监听行工具事件
        table.on('tool(filter)', function (obj) { //注：tool 是工具条事件名，test 是 table 原始容器的属性 lay-filter="对应的值"
            var id = obj.data.id //获得当前行数据
                , layEvent = obj.event; //获得 lay-event 对应的值
            if (layEvent === 'detail') {
                // openModak(id);
            } else if (layEvent === 'del') {
                layer.confirm('确定删除？', function (id) {
                    obj.del(); //删除对应行（tr）的DOM结构
                    layer.close(id);
                    $.ajax({
                            type: 'get',
                            url: "/system/activity/generalIntegral/delete",
                            data: {'id': id},
                            dataType: 'json',
                            success: function () {
                                layer.msg("删除成功");
                            }, fail: function () {
                                layer.msg("删除失败");
                            }
                        }
                    );
                    //向服务端发送删除指令
                });
            } else if (layEvent === 'edit') {
                layer.msg('编辑操作');
            }
        });

        table.on('tool(layui-filter)', function (obj) { //注：tool 是工具条事件名，test 是 table 原始容器的属性 lay-filter="对应的值"
            var id = obj.data.id //获得当前行数据
                , layEvent = obj.event; //获得 lay-event 对应的值
            if (layEvent === 'detail') {
                // openModak(id);
            } else if (layEvent === 'del') {
                layer.confirm('确定删除？', function (id) {
                    obj.del(); //删除对应行（tr）的DOM结构
                    layer.close(id);
                    $.ajax({
                            type: 'get',
                            url: "/system/activity/generalIntegral/delete",
                            data: {'id': id},
                            dataType: 'json',
                            success: function () {
                                layer.msg("删除成功");
                            }, fail: function () {
                                layer.msg("删除失败");
                            }
                        }
                    );
                    //向服务端发送删除指令
                });
            } else if (layEvent === 'edit') {
                layer.open({
                    type: 2,
                    title: "修改发放比例", //不显示标题栏
                    closeBtn: 2,
                    area: ['200px', '300px'],//定义宽和高
                    shade: 0.8,
                    id: (new Date()).valueOf(), //设定一个id，防止重复弹出 时间戳1280977330748
                    btn: ['保存', '取消'],
                    btnAlign: 'r',
                    moveType: 1, //拖拽模式，0或者1
                    content: "/system/activity/generalIntegral/updateIntegeralProportionRule?data=" + escape(JSON.stringify(obj.data)),
                    // content: generatintegral_proportion_rule_edit.html,
                    yes: function (index, layero) {
                        var btn = layero.find('.layui-layer-btn').find('.layui-layer-btn0');
                        alert("-----");
                        try {
                            var _ifr = btn[0].parentNode.parentNode.getElementsByClassName("layui-layer-content")[0].children[0].contentWindow ||
                                btn[0].parentNode.parentNode.getElementsByClassName("layui-layer-content")[0].children[0].children[0].contentWindow;
                            var func = new Function('_ifr', "return _ifr." + sucFunName + "();");
                            var flg = func(_ifr);
                            if (flg == false) {
                                return false;
                            } else {
                                if (callBack != null) callBack();
                                window.location.reload();
                            }
                        } catch (ex) {

                        }
                    },
                    btn2: function (index, layero) {
                    }
                });
            }
        });

    });


    function prefecture() {
        layer.open({
            type: 2,//类型
            area: ['1000px', '600px'],//定义宽和高
            title: '购买获赠积分规则',//题目
            shadeClose: false,//点击遮罩层关闭
            content: '/system/activity/generalIntegral/toPrefecture',
            // content: $("#pop-box"),
            cancel: function () {
                // $("#motaikunag").css("display", "none");
            }
        });

    }

    function integralSpeedRule() {
        layer.open({
            type: 2,//类型
            area: ['1000px', '600px'],//定义宽和高
            title: '积分加速器比例',//题目
            shadeClose: false,//点击遮罩层关闭
            content: '/system/activity/generalIntegral/toIntegralSpeedRule',
            // content: $("#pop-box"),
            cancel: function () {
                // $("#motaikunag").css("display", "none");
            }
        });
    }

    function openModak(obj) {
        var id = obj.id;
        $("#motaikunag").css("display", "none");
        layui.use(['layer', 'table'], function () {
            // var layer = layui.layer, $ = layui.$;
            var table = layui.table;
            layer.open({
                type: 2,//类型
                area: ['1000px', '600px'],//定义宽和高
                title: '推荐人发放规则',//题目
                shadeClose: false,//点击遮罩层关闭
                content: '/system/activity/generalIntegral/toInviteeRuleList',
                // content: $("#motaikunag"),
                cancel: function () {
                    // $("#motaikunag").css("display", "none");
                }
            });
        });
    }
    function openAmplify(obj){
        // var id = obj.id;
        // $("#motaikunag").css("display", "none");
        layui.use(['layer', 'table'], function () {
            // var layer = layui.layer, $ = layui.$;
            var table = layui.table;
            layer.open({
                type: 2,//类型
                area: ['1000px', '600px'],//定义宽和高
                title: '放大规则',//题目
                shadeClose: false,//点击遮罩层关闭
                content: '/system/activity/generalIntegral/toMemberRuleList',
                // content: $("#motaikunag"),
                cancel: function () {
                    // $("#motaikunag").css("display", "none");
                }
            });
        });
    }
    //openStore
    function openStore(obj){
        // var id = obj.id;
        // $("#motaikunag").css("display", "none");
        layui.use(['layer', 'table'], function () {
            // var layer = layui.layer, $ = layui.$;
            var table = layui.table;
            layer.open({
                type: 2,//类型
                area: ['1000px', '600px'],//定义宽和高
                title: '二维码',//题目
                shadeClose: false,//点击遮罩层关闭
                content: '/system/activity/generalIntegral/toAppStore',
                // content: $("#motaikunag"),
                cancel: function () {
                    // $("#motaikunag").css("display", "none");
                }
            });
        });
    }
    //openStoreUrl
    function openStoreUrl(obj){
        // var id = obj.id;
        // $("#motaikunag").css("display", "none");
        layui.use(['layer', 'table'], function () {
            // var layer = layui.layer, $ = layui.$;
            var table = layui.table;
            layer.open({
                type: 2,//类型
                area: ['1000px', '600px'],//定义宽和高
                title: '下载地址',//题目
                shadeClose: false,//点击遮罩层关闭
                content: '/system/activity/generalIntegral/toAppStoreUrl',
                // content: $("#motaikunag"),
                cancel: function () {
                    // $("#motaikunag").css("display", "none");
                }
            });
        });
    }
    //openReverse    toReverseMultipleRule
    function openReverse(obj){
        layui.use(['layer', 'table'], function () {
            var table = layui.table;
            layer.open({
                type: 2,//类型
                area: ['1700px', '600px'],//定义宽和高
                title: '用户系数',//题目
                shadeClose: false,//点击遮罩层关闭
                content: '/system/activity/generalIntegral/toReverseMultipleRule',
            // content: $("#motaikunag"),
                cancel: function () {
                // $("#motaikunag").css("display", "none");
                }
            });
        });
    }
    //openGroupRule
    function openGroupRule(obj){
        // var id = obj.id;
        // $("#motaikunag").css("display", "none");
        layui.use(['layer', 'table'], function () {
            // var layer = layui.layer, $ = layui.$;
            var table = layui.table;
            layer.open({
                type: 2,//类型
                area: ['1700px', '600px'],//定义宽和高
                title: '团队规则',//题目
                shadeClose: false,//点击遮罩层关闭
                content: '/system/activity/generalIntegral/toGroupRule',
                // content: $("#motaikunag"),
                cancel: function () {
                // $("#motaikunag").css("display", "none");
                }
            });
        });
    }
    //opennvitee
function opennvitee(obj){
    // var id = obj.id;
    // $("#motaikunag").css("display", "none");
    layui.use(['layer', 'table'], function () {
        // var layer = layui.layer, $ = layui.$;
        var table = layui.table;
        layer.open({
            type: 2,//类型
            area: ['1600px', '600px'],//定义宽和高
            title: '被邀请人规则',//题目
            shadeClose: false,//点击遮罩层关闭
            content: '/system/activity/generalIntegral/toInviteeRuleList',
            // content: $("#motaikunag"),
            cancel: function () {
                // $("#motaikunag").css("display", "none");
            }
        });
    });
}
function openGeneralIntegralSpeedRule(obj){
    // var id = obj.id;
    // $("#motaikunag").css("display", "none");
    layui.use(['layer', 'table'], function () {
        // var layer = layui.layer, $ = layui.$;
        var table = layui.table;
        layer.open({
            type: 2,//类型
            area: ['1000px', '600px'],//定义宽和高
            title: '通用积分加速器',//题目
            shadeClose: false,//点击遮罩层关闭
            content: '/system/activity/generalIntegral/toGeneralIntegralSpeedRule',
            // content: $("#motaikunag"),
            cancel: function () {
                // $("#motaikunag").css("display", "none");
            }
        });
    });
}
//openMember
function openMember(obj){
    // var id = obj.id;
    // $("#motaikunag").css("display", "none");
    layui.use(['layer', 'table'], function () {
        // var layer = layui.layer, $ = layui.$;
        var table = layui.table;
        layer.open({
            type: 2,//类型
            area: ['1700px', '600px'],//定义宽和高
            title: '兑换比例',//题目
            shadeClose: false,//点击遮罩层关闭
            content: '/system/activity/generalIntegral/toMemberRuleList',
            // content: $("#motaikunag"),
            cancel: function () {
                // $("#motaikunag").css("display", "none");
            }
        });
    });
}
//openProducts
function openProducts(obj){
    // var id = obj.id;
    // $("#motaikunag").css("display", "none");
    layui.use(['layer', 'table'], function () {
        // var layer = layui.layer, $ = layui.$;
        var table = layui.table;
        layer.open({
            type: 2,//类型
            area: ['1000px', '600px'],//定义宽和高
            title: '兑换比例',//题目
            shadeClose: false,//点击遮罩层关闭
            content: '/system/activity/generalIntegral/toProducts',
            // content: $("#motaikunag"),
            cancel: function () {
                // $("#motaikunag").css("display", "none");
            }
        });
    });
}
</script>
<script>
    layui.config({
        version: '1620578627928' //为了更新 js 缓存，可忽略
    });

        //加载模块
        layui.use(['laydate', 'laypage', 'layer', 'table', 'carousel', 'upload', 'element'],function () { //亦可加载特定模块：layui.use(['layer', 'laydate', function(){
            //得到各种内置组件
            var layer = layui.layer //弹层
                , laypage = layui.laypage //分页
                , laydate = layui.laydate //日期
                , table = layui.table //表格
                , carousel = layui.carousel //轮播
                , upload = layui.upload //上传
                , element = layui.element //元素操作
                , slider = layui.slider //滑块
                , dropdown = layui.dropdown //下拉菜单

            //向世界问个好
            layer.msg('Hello World');

            //监听Tab切换
            element.on('tab(demo)', function (data) {
                layer.tips('切换了 ' + data.index + '：' + this.innerHTML, this, {
                    tips: 1
                });
            });

            //执行一个 table 实例
            table.render({
                elem: '#demo'
                , height: 420
                , url: '/system/member/allWeixinUser' //数据接口
                , title: '用户表'
                , page: true //开启分页
                , toolbar: 'default' //开启工具栏，此处显示默认图标，可以自定义模板，详见文档
                , totalRow: true //开启合计行
                , cols: [[ //表头
                    {type: 'checkbox', fixed: 'left'}
                    , {field: 'id', title: 'ID', width: 80, sort: true, fixed: 'left', totalRowText: '合计：'}
                    , {field: 'nickname', title: '用户名', width: 80}
                    , {field: 'sex', title: '性别', width: 80, sort: true,
                        templet : function(data) {// 替换数据
                        if (data.sex == 0) {
                        return "男";
                        } else if (data.sex == 1) {
                        return "女";
                        } }}
                    , {field: 'mobile', title: '手机号', width: 100}
                    , {field: 'level', title: '用户级别', width: 90, sort: true, totalRow: true,
                        templet : function(data) {// 替换数据
                            if (data.level == 1) {
                                return "普通用户";
                            } else if (data.level == 2) {
                                return "会员";
                            } else if(data.level==3){
                                return "推广者";
                            }}
                    }
                    //, {field: 'experience', title: '消费金额', width: 90, sort: true, totalRow: true}
                    , {field: 'speed_integral', title: '原始积分', width: 80, sort: true, totalRow: '{{ parseInt(d.TOTAL_NUMS) }} 分'}
                    , {field: 'forecast_speed_integral', title: '预计获得兑货卷', width: 150}
                    //, {field: 'speed_integral', title: '已获得兑货卷', width: 200}
                    , {field: 'coin', title: '佣金', width: 135, sort: true, totalRow: true}
                    , {field: 'bill_coupon', title: '提货卷', width: 135, sort: true, totalRow: true}
                    , {field: 'create_time', title: '注册时间', width: 135, sort: true, totalRow: true,
                        templet : "<div>{{layui.util.toDateString(d.createTime, 'yyyy-MM-dd HH:mm:ss')}}</div>"}
                    , {fixed: 'right', width: 300, align: 'center', toolbar: '#barDemo1'}
                ]]
            });
            //监听头工具栏事件
            table.on('toolbar(test)', function (obj) {
                var checkStatus = table.checkStatus(obj.config.id)
                    , data = checkStatus.data; //获取选中的数据
                switch (obj.event) {
                    case 'add':
                        layer.msg('添加');
                        break;
                    case 'update':
                        if (data.length === 0) {
                            layer.msg('请选择一行');
                        } else if (data.length > 1) {
                            layer.msg('只能同时编辑一个');
                        } else {
                            layer.alert('编辑 [id]：' + checkStatus.data[0].id);
                        }
                        break;
                    case 'delete':
                        if (data.length === 0) {
                            layer.msg('请选择一行');
                        } else {
                            layer.msg('删除');
                        }
                        break;
                };
            });

            //监听行工具事件
            table.on('tool(test)', function (obj) { //注：tool 是工具条事件名，test 是 table 原始容器的属性 lay-filter="对应的值"
                var data = obj.data //获得当前行数据
                    , layEvent = obj.event; //获得 lay-event 对应的值
                if (layEvent === 'edit1') {
                    // var checkStatus = table.checkStatus('id');
                    var id = data.id;
                    let mobile = data.mobile;
                    let level=data.level;
                    let speed_integral=data.speed_integral;
                    let forecast_speed_integral=data.forecast_speed_integral;
                    let coin=data.coin;
                    let bill_coupon=data.bill_coupon;
                    $("#mobile").val(mobile);
                    $("#speed_integral").val(speed_integral);
                    $("#forecast_speed_integral").val(forecast_speed_integral);
                    $("#coin").val(coin);
                    $("#bill_coupon").val(bill_coupon);
                    $("#level").val(level);
                    layer.open({
                        type:1,
                        title: "个人账户设置",
                        area: ['600px', '300px'],
                        btn: ["确定", "取消"],
                        content: $("#motaikuang444"),
                        yes: function (index, layero) { // 确认按钮回调函数
                            // 监听提交按钮
                            //mobile  level speed_integral forecast_speed_integral coin bill_coupon
                            var mobile = $("#mobile").val();
                            var level = $("#level").val();
                            var speed_integral = $("#speed_integral").val();
                            var forecast_speed_integral = $("#forecast_speed_integral").val();
                            var coin = $("#coin").val();
                            var bill_coupon=$("#bill_coupon").val();
                            var id = data.id;
                            $.ajax({
                                type: "get",
                                url: "/system/member/updateMemberPoints",
                                data: {
                                    mobile: mobile,
                                    speed_integral:speed_integral,
                                    level:level,
                                    id:id,
                                    forecast_speed_integral:forecast_speed_integral,
                                    coin:coin,
                                    bill_coupon:bill_coupon
                                },
                                dataType: "json",
                                success: function () {
                                    $("#motaikuang444").css("display","none")
                                    alert("修改成功");
                                }
                            })
                        },
                        btn2: function (index, layero) { // 取消按钮回调函数
                            $("#motaikuang444").css("display","none")
                            layer.close(index); // 关闭弹出层
                        }
                    });
                } else if (layEvent === 'InviteTheDetail') {
                    layer.open({
                        type:1,
                        title: "个人账户设置",
                        area: ['600px', '300px'],
                        btn: ["确定", "取消"],
                        content: $("#motaikuang2"),
                        yes: function (index, layero) { // 确认按钮回调函数
                            // 监听提交按钮
                            var id = 111777;
                            $.ajax({
                                type: "get",
                                url: "/system/recommended/UserDeliveryVolume",
                                data: {
                                    id:id
                                },
                                dataType: "json",
                                success: function (data) {
                                    $("#id1").val(data.id);
                                }
                            })
                        },
                        btn2: function (index, layero) { // 取消按钮回调函数
                            $("#motaikuang2").css("display","none")
                            layer.close(index); // 关闭弹出层
                        }
                    });
                }
            });

            //执行一个轮播实例
            carousel.render({
                elem: '#test1'
                , width: '100%' //设置容器宽度
                , height: 200
                , arrow: 'none' //不显示箭头
                , anim: 'fade' //切换动画方式
            });

            //分页
            laypage.render({
                elem: 'pageDemo' //分页容器的id
                , count: 1000 //数据总数
                , limit: 10 //每页显示的数据条数
                , skin: '#1E9FFF' //自定义选中色值
                //,layout: ['prev', 'page', 'next', 'count', 'limit', 'refresh', 'skip'] //自定义排版
                , jump: function (obj, first) {
                    if (!first) {
                        layer.msg('第' + obj.curr + '页', {offset: 'b'});
                    }
                }
            });

            //上传
            upload.render({
                elem: '#uploadDemo'
                , url: 'https://httpbin.org/post' //改成您自己的上传接口
                , done: function (res) {
                    layer.msg('上传成功');
                    layui.$('#uploadDemoView').removeClass('layui-hide').find('img').attr('src', res.files.file);
                    console.log(res)
                }
                , before: function () {
                    layer.msg('上传中', {icon: 16, time: 0});
                }
            });

            //滑块
            var sliderInst = slider.render({
                elem: '#sliderDemo'
                , input: true //输入框
            });

            //底部信息
            // var footerTpl = lay('#footer')[0].innerHTML;
            // lay('#footer').html(layui.laytpl(footerTpl).render({}))
            //     .removeClass('layui-hide');
        });
</script>
</body>
</html>
